﻿<%@ Page Title="Horários" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="CadastroHorario.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroHorario" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="../Scripts/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
    <link href="../css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .form-inlin
        {
            width: 202px;
        }
        .style10
        {
            width: 157px;
        }
        .style13
        {
            width: 158px;
        }
        .style14
        {
            width: 163px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consulta de Horários">
        <table class="form-inline">
            <tr>
                <td class="style13">
                    <asp:Label ID="Label1" runat="server" Text="Turno"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlTurnoPesquisa" Width="150px" runat="server" 
                        AutoPostBack="True" 
                        onselectedindexchanged="ddlTurnoPesquisa_SelectedIndexChanged">
                        <asp:ListItem Text="Manhã" Value="M"></asp:ListItem>
                        <asp:ListItem Text="Tarde" Value="T"></asp:ListItem>
                        <asp:ListItem Text="Noite" Value="N"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="style1">
                    <br />
                    <asp:Button ID="btnConsultar" runat="server" Text="Consultar" OnClick="btnConsultar_Click"
                        Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_HORARIO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
            Width="45%" AllowPaging="True" OnPageIndexChanging="gvwPesquisa_PageIndexChanging"
            OnRowCreated="gvwPesquisa_RowCreated" 
            OnRowDataBound="gvwPesquisa_RowDataBound" onrowcommand="gvwPesquisa_RowCommand">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:TemplateField HeaderText="Editar" ShowHeader="False">
                    <ItemTemplate>
                        <abbr>
                            <asp:ImageButton ID="ImgAlterar" runat="server" CausesValidation="false" CommandName="Alterar"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/edit.png" Text="Alterar"
                                Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Excluir">
                            <asp:ImageButton ID="Excluir" formnovalidate="formnovalidate" runat="server" CausesValidation="false"
                                OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                CommandName="Excluir" ImageUrl="~/Imagens/delete.png" Text="Excluir" Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="HORA_INICIO" HeaderText="Hora Início">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="HORA_FIM" HeaderText="Hora Fim">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="SITUACAO" HeaderText="SITUACAO">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="TURNO" HeaderText="TURNO">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <div>
            &nbsp;&nbsp;
        <asp:Button ID="btnInserir" runat="server" Text="Inserir" 
            onclick="btnInserir_Click" Width="100px" />
        </div>
        <br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlCadastro" runat="server" GroupingText="Cadastro de Horários" Visible="false">
        <table class="form-inline">
            <tr>
                <td class="style14">
                    Turno
                </td>
                <td class="style10">
                    Situação
                </td>
            </tr>
            <tr>
                <td class="style14">
                    <asp:DropDownList ID="ddlTurnoCadastro" runat="server" Width="150px">
                        <asp:ListItem Text="Manhã" Value="M"></asp:ListItem>
                        <asp:ListItem Text="Tarde" Value="T"></asp:ListItem>
                        <asp:ListItem Text="Noite" Value="N"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="style10">
                    &nbsp;<asp:DropDownList ID="ddlSituacao" runat="server" Width="150px">
                        <asp:ListItem Text="Ativo" Value="A"></asp:ListItem>
                        <asp:ListItem Text="Inativo" Value="I"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style14">
                    Hora Início
                </td>
                <td class="style10">
                    Hora Fim
                </td>
            </tr>
            <tr>
                <td class="style14">
                    <asp:TextBox ID="txtHoraInicio" Font-Size="Medium" type="time" min="6:00" 
                        value="08:00" max="22:00"
                        step="600" required Width="145px" MaxLength="5" runat="server"></asp:TextBox>
                </td>
                <td class="style10">
                    <asp:TextBox ID="txtHoraFim" Font-Size="Medium" type="time" min="6:00" 
                        value="18:00" max="22:00"
                        step="600" required Width="145px" MaxLength="5" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" Width="100px" 
                onclick="btnConfirmar_Click" />
            &nbsp;
            <asp:Button ID="btnCancelar" formnovalidate="formnovalidate" runat="server" Text="Cancelar"
                Width="100px" onclick="btnCancelar_Click" />
            <br />
            <br />
        </div>
    </asp:Panel>
</asp:Content>
